package com.achao.future;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.luojilab.component.componentlib.router.ui.UIRouter;
import com.luojilab.router.facade.annotation.RouteNode;

/**
 * @author LiuChao
 * @describe
 * @date 2018/6/22
 * @contact email:450127106@qq.com
 */
@RouteNode(path = "/app/home", desc = "index page")
public class MainActivity extends AppCompatActivity {
    int i=0;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.to_login).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                arouter();
            }
        });

        findViewById(R.id.to_main2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //ARouter.getInstance().build("/app/main2").navigation(MainActivity.this);
                UIRouter.getInstance().openUri(MainActivity.this, "JIMU://app/app/main2", null);
            }
        });

    }

    private void arouter() {
        ARouter.getInstance().build("/login/home").navigation(MainActivity.this);
    }

}
